**********************
**** Histograms ******
**********************
clear all
set more off
set scheme plotplain

use "/Users/yasenov/Desktop/replication package/master.dta"

***************
** FIGURE 1 ***
***************
replace grade = 0 if grade == .
tab grade
gen byte bytegrade = grade   //because of histogram x-axis labels

twoway hist bytegrade, discrete ///
	xtitle("Grade", size(large)) ///
	xlabel(,labsize(medium)) ///
	ylabel(,labsize(medium)) ///
	plotregion(lwidth(none)) ///
	graphregion(margin(zero)) ///
	ytitle("")

***************
** FIGURE 2 ***
***************
twoway hist starttime_nocode, discrete ///
	title("Panel A: School Start Time", size(large)) ///
	xtitle("Start Time", size(large)) ///
	xlabel(6.5 `""6:30""am""' 7.33333 "7:20" 8.25 "8:15" 9.083333 "9:10" 12.5 `""12:30""pm""' 13.3333 "1:20" 14.25 "2:15" 15.08333 "3:10", labsize(small)) ///
	xlabel(,labsize(medsmall)) ///
	ylabel(,labsize(medium)) ///
	plotregion(lwidth(none)) ///
	graphregion(margin(zero)) ///	
	ytitle("") nodraw
graph copy one, replace	

twoway hist SDstarttime_nocode, ///
	title("Panel B: School Start Time, Standard Deviation", size(medlarge)) ///
	xtitle(" SD(Start Time)", size(large)) ///  *{&sigma}
	xlabel(,labsize(medium)) ///
	ylabel( ,labsize(medium)) ///
	plotregion(lwidth(none)) ///
	graphregion(margin(zero)) ///	
	ytitle("") nodraw
graph copy two, replace

graph combine one two, r(1) ///
	plotregion(lwidth(none)) ///
	graphregion(margin(zero)) ///
	imargin(tiny)
